package cn.net.cfss.fgbp.auth.config;


import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;


@Component
public class ConfigProperty implements ApplicationContextAware {

    private static ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        if (this.applicationContext == null) {
            this.applicationContext = applicationContext;
        }

    }



    @Value("${jwt.blacklist.key.format}")
    public String jwtBlacklistKeyFormat;

    @Value("${jwt.secret.key}")
    public String secretKey;

    @Value("${token.expire.time}")
    public Long tokenExpireTime;
    @Value("${jwt.token.expire.time}")
    public Long jwtTokenExpireTime;

    @Value("${application.version}")
    public String appversion;

    @Value("${application.name}")
    public String appName;

    public static ConfigProperty getIns()
    {
         return applicationContext.getBean(ConfigProperty.class);
    }


}
